package com.zw.log.controller;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zw.log.service.SysOperLogService;
import com.zw.object.result.Result;
import com.zw.object.system.SysOperLog;
import com.zw.object.vo.SysOperLogQueryVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 操作日志记录 前端控制器
 * </p>
 *
 * @author zw
 * @since 2022-12-13
 */
@Api(tags = "操作日志")
@RestController
@RequestMapping("/admin/system/operlog")
public class SysOperLogController {
    @Autowired
    private SysOperLogService sysOperLogService;


    /**
     *                          操作日志获取分页查询
     * @param page              当前页码
     * @param limit             每页显示大小
     * @param sysOperLogQueryVo 参数实体类
     * @return                  Result
     */
    @ApiOperation("操作日志分页获取")
    @PostMapping("/{page}/{limit}")
    public Result sysOperLogListPage(@PathVariable("page")Long page,
                                     @PathVariable("limit")Long limit,
                                     @RequestBody SysOperLogQueryVo sysOperLogQueryVo){
        IPage<SysOperLog> iPage = new Page<>(page, limit);
        return sysOperLogService.sysOperLogListPage(iPage,sysOperLogQueryVo);
    }
}

